package week02;

public class T019 {
	
	public static int run(int year,int month,int day) {
		if(month<3) {
			year--;
			month+=12;
		}
		int c = year/100,y=year%100,m=month,d=day;
		return (c/4-2*c+y+y/4+13*(m+1)/5+d-1)%7;
	}
	
	public static void main(String[] args) {
		int sum=0;
		for(int year=1901;year<=2000;year++) {
			for(int month=1;month<=12;month++) {
				if(run(year, month, 1)==0) sum++;
			}
		}
		System.out.println(sum);
	}

}
